/**
   A class to convert degree, minute, seconds to decimal degrees
*/
public class Degrees
{
   /**
      Converts minutes and seconds to decimal degrees 
      @param degrees the degrees between -359 and 359
      @param minutes the minutes between 0 and 59
      @param seconds the minutes between 0 and 59
      @return the equivalent decimal degrees between -360 and 360 (exclusive)
   */
   public double decimalDegrees(int degrees, int minutes, int seconds)
   {
      double d=(double)degrees,m=(double)minutes,s=(double)seconds;
      int k=1;
      if(d<0){
         d=Math.abs(d);
         k=0;
      }
      
      m+=s/60;
   	d+=m/60;
   	if(k==0)
   	   d=-d;
   	
   	return d;
   }
}